﻿using System;

namespace Communication.Message.Osc
{
	// Token: 0x02000034 RID: 52
	internal class OscUtils
	{
		private OscUtils()
		{
		}
		/// <summary>
		/// CRC8
		/// </summary>
		/// <param name="buf"></param>
		/// <param name="offset"></param>
		/// <param name="len"></param>
		/// <returns></returns>
		/// <exception cref="IndexOutOfRangeException"></exception>
		public static byte Crc8(byte[] buf, int offset, int len)
		{
			if (offset < 0 || offset + len > buf.Length)
			{
				throw new IndexOutOfRangeException();
			}
			byte b = 0;
			for (int i = offset; i < offset + len; i++)
			{
				b += buf[i];
			}
			return b;
		}
	}
}
